package jpm.position;

import java.util.Collections;
import java.util.Set;
import java.util.TreeSet;

public final class PositionValue {		

	// this class cannot be mutated outside the package
	
	PositionValue() {}
	// cannot be created outside the package
	
	public int getQuantity() {
		return quantity;
	}

	void addQuantity(int quantity) {
		this.quantity += quantity;
	}

	public Set<Integer> getTradeIds() {
		return Collections.unmodifiableSet(tradeIds);
	}

	void addTradeId(int tradeId) {
		tradeIds.add(tradeId);
	}
	
	void removeTradeId(int tradeId) {
		tradeIds.remove(tradeId);
	}

	private int quantity;
	private Set<Integer> tradeIds = new TreeSet<>();		
}
